#ifndef SETTINGS_H
#define SETTINGS_H

#include<QObject>
#include<QString>

class Settings: public QObject{
Q_OBJECT
public:
	struct General;
	struct LastFM;
	static Settings *instance();
	void write();
	bool isChanged()const;
	QString settingsDir()const{ return SETTINGS_DIR; }
	
	General *general;
	LastFM *lastfm;
signals:
	void changed();
	void generalChanged();
	void lastfmChanged();
private:
	Settings(const QString &filename);
	void defaultSettings();
	void readGeneralSetting(QString setting, QString value);
	void readLFMSetting(QString setting, QString value);
	static Settings *_settings;
	static const QString SETTINGS_FILE;
	static const QString SETTINGS_DIR;
};

struct Settings::General{
	QString musicDir;
	bool usePlaylist;//For save on exit and load on startup
//Be a good boy and don't touch this :-)
	bool _changed;
};

struct Settings::LastFM{
	bool offerCorrections;
	bool isScrobbling;//WARNING: This is not written to the settings file, but managed by Scrobbler itself through its session file.
//Be a good boy and don't touch this :-)
	bool _changed;
};

#endif
